<h4>KARTU RENCANA STUDI &raquo; ENTRI KARTU RENCANA STUDI &raquo; <span class="current_page">TAMBAH MATAKULIAH</span></h4>

            <!-- Begin three column window -->
<div class="onecolumn" style="padding-bottom:20px">
    <div class="header">
    	<span>MATAKULIAH DITAWARKAN SEMESTER <?php echo strtoupper($kontrol->SEMESTER).' '.$kontrol->TAHUN_AJARAN ?></span>
    </div>
    <br class="clear"/>
    <div class="content">
      <form method="post" name="mkform" action="<?php echo base_url().'siam/tambah-mk.html' ?>">
        <table class="data" width="100%" cellpadding="0" cellspacing="0">
            <thead>
            <tr>
                <th width="360">No.</th>
                <th width="50">Hari</th>
                <th width="97">Jam</th>
                <th width="70">Kode MK</th>
                <th width="210">Nama MK</th>
                <th width="50">Kelas</th>
                <th width="50">Ruang</th>
                <th width="30">SKS</th>
                <th width="35">Smt.</th>
                <th width="50">W/P</th>
                <th width="30">Pst.</th>
                <th width="46">Kuota</th>
                <th width="120">Prasyarat</th>
            </tr>
            </thead>

            <?php if($getDataMkDitawarkan): ?>

            <?php $seq_number =1; ?>
            <?php foreach($getDataMkDitawarkan as $mk): ?>
            <?php $jumlah_peminat = $this->akad_model->jumlahPeminatMk($mk->KODE_PRODI,$mk->KODE_MK,$mk->KELAS,$mk->SEMESTER,$mk->TAHUN); ?>
            <?php $maks_kapasitas_kelas = $this->akad_model->kapasitasKelasMk($mk->KODE_PRODI,$mk->KODE_MK,$mk->KELAS,$mk->SEMESTER,$mk->TAHUN); ?>
            <?php $cek_prasyarat_mk = $this->krs_library->check_prasyarat_mk($this->session->userdata('siamunp_user'),$mk->KODE_PRASYARAT1, $mk->KODE_PRASYARAT2); ?>
            <?php $mk_prasyarat1 = $this->akad_model->getKodeMkByNoMk($mk->KODE_PRASYARAT1);?>
            <?php $mk_prasyarat2 = $this->akad_model->getKodeMkByNoMk($mk->KODE_PRASYARAT2);?>

            <?php $has_entried = 0; ?>
            <?php if($krs): ?>
            <?php foreach($krs as $krsValue):?>
               <?php if ($mk->KODE_MK == $krsValue->KODE_MK): ?>
                      <?php $has_entried = 1;?>
               <?php endif; ?>
            <?php endforeach; ?>
            <?php endif; ?>

            <?php if($kelompokkelas == $mk->KELAS): ?>
            <tr>
              <td><?php echo $seq_number; ?>.
               <input type="checkbox" value="<?php echo $mk->ID_MK_TERSEDIA ?>" name="mk" onClick="javascript:checkBoxValidate(<?php echo $seq_number-1; ?>)" <?php if( ($jumlah_peminat < $maks_kapasitas_kelas->KAPASITAS) && ($cek_prasyarat_mk > 0) && ($has_entried == 0) ): ?> <?php else: ?>DISABLED <?php endif; ?> />
              </td>
              <td align="left" style="padding-left:10px"><?php echo ucwords(strtolower($mk->HARI)); ?></td>
              <td><?php echo $mk->MULAI.' - '.$mk->SELESAI; ?></td>
              <td><?php echo strtoupper($mk->KODE_MK); ?></td>
              <td align="left" style="padding-left:10px"><?php echo $mk->NAMA_MK; ?></td>
              <td><?php echo $mk->KELAS ?></td>
              <td><?php echo $mk->RUANG ?></td>
              <td><?php echo $mk->SKS ?></td>
              <td><?php echo $mk->SEMESTER_MK; ?></td>
              <td><?php echo $mk->SIFAT ?></td>
              <td><?php echo $jumlah_peminat ?></td>
              <td><?php echo $maks_kapasitas_kelas->KAPASITAS ?></td>
              <td><?php if($mk->KODE_PRASYARAT1):?><?php echo $mk_prasyarat1->KODE_MK ?> <?php endif; ?> <?php if($mk->KODE_PRASYARAT1 && $mk->KODE_PRASYARAT2):?><?php echo ','?><?php endif;?> <?php if($mk->KODE_PRASYARAT2):?><?php echo $mk_prasyarat2->KODE_MK ?><?php endif; ?></td>
            </tr>
            <?php $seq_number++; ?>
            <?php endif ?>

            <?php endforeach; ?>

            <?php else: ?>

            <tr>
              <td height="28" colspan="13" style="padding-left:20px">Data tidak tersedia.</td>
            </tr>

            <?php endif; ?>

   </table>
   <br />
   <div align="center">
     <button class="sexybutton sexysimple sexyblue" type="submit" value="Pilih" name="pilih">Pilih</button>&nbsp;&nbsp;
     <button class="sexybutton sexysimple sexymagenta" type="button" value="Batal" name="batal" onclick="self.location='entri-krs.html'">Batal</button>
   </div>
   </form>
 </div>
</div>